package com.yami.shop.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @author DELL
 */
@Configuration
@ConfigurationProperties(prefix = "mall4j")
@Data
public class Mall4jProperties {

    /**
     * 推荐系统相关配置分组
     */
    private RecommendConfig recommend = new RecommendConfig();

    /**
     * 邮件配置（若有其他需求可扩展）
     */
    private MailConfig mail = new MailConfig();

    /** 推荐系统子配置 */
    @Data
    public static class RecommendConfig {
        private Integer personalLimit = 20;
        private Integer hotLimit = 30;
        private String strategy = "CTR";
        //开启缓存
        private String cache;
    }

    /** 邮件配置子类（示例） */
    @Data
    public static class MailConfig {
        private String host;
        private Integer port;
    }
}
